package cn.itsource.exam.mapper;

import cn.itsource.exam.domain.Permission;
import cn.itsource.exam.domain.Permission;
import cn.itsource.exam.query.PermissionQueryVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PermissionMapper {
    
    void delete(Long permissionId) ;

    //批量删除
    void batchDelete(Long[] permissionIds);

    void insert(Permission permission);

    void update(Permission permission);

    Permission selectByPermissionId(Long permissionId);

    List<Permission> selectPermissionList(PermissionQueryVo permissionQueryVo);

    Permission selectByPermissionName(String name);

    Integer selectCount(PermissionQueryVo permissionQueryVo);

    List<Permission> selectAll();

    List<Permission> selectRolePermissions(Long roleId);

    List<Permission> selectRoleNoPermissions(Long roleId);

    //保存角色权限关系
    void addRolePermission(@Param("rid") Long rid, @Param("pids") Long[] pids);

    //删除角色权限关系
    void RolePermission(Long rid);
    //根觉用户id查对应得菜单
    List<Permission> getPermissionByUserId(String id);
}
